#include<iostream>
#include<ctime>
#include<cmath>
#include<fstream>
#include "vector.h"
using namespace std;

int SPARE_CAPACITY = 16;

int main(int args, char* argvs[]){
	
    ofstream result;

	result.open("result", ios::out);
	result << "Spare_Capacity " << "Time " << "Space" << endl;
	
	int max_size = atoi(argvs[1]);

	time_t start;
	time_t end;
	double t_time;

	Vector<int>* vec = nullptr;
	
    for(int _C=0; _C<max_size; ++_C){
		SPARE_CAPACITY = _C;
		start = clock();
		for(int j=1; j<=max_size; ++j){
			vec = new Vector<int>(j);
			for(int n=1; n<=max_size-(*vec).size(); ++n){
				(*vec).push_back(0);
			}
			delete vec;
			vec = nullptr;
		}
		end = clock();
		double endtime=(double)(end-start)/CLOCKS_PER_SEC;
		result << _C << " " << endtime << " "<< 1.0 * _C * _C/2 - 1.0*_C/2 << endl;
	}
	
	return 0;
}
